<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import="java.util.*, cs5226.util.StringUtil" %>
<jsp:useBean id="baseline" class="cs5226.model.BaselineBean" scope="page"/>
<%
	List aList = null;
	baseline=null;
	if(null!=request.getAttribute("baselinesList"))
		aList = (List) request.getAttribute("baselinesList");
%>

<h2>Baseline Comparison Home</h2>
	
<br/><br/><br/>

<style>

table
{
border-collapse:collapse;
}
table,th, td
{
border: 1px solid gray;
}
</style>


<form action='baseline-compare'>

		<%
			if (request.getAttribute("msg") != null) {
		%>
		<center><font color="red"><%=request.getAttribute("msg")%></font></center>
		<%
			}
		%>
<table>
	<tr height="30">
		<td align="center" width="5%"><b>S/N</b></td>
		<td align="center"  width="15%"><b>Baseline	ID</b></td>
		<td align="center"  width="15%"><b>Baseline Name</b></td>
		<td align="center"  width="15%"><b>START SNAP ID</b></td>
		<td align="center"  width="15%"><b>START SNAP Time</b></td>
		<td align="center"  width="15%"><b>END SNAP ID</b></td>
		<td align="center"  width="15%"><b>END SNAP Time</b></td>		
		<td align="center"  width="5%">&nbsp;</td>
	</tr>
	<%if(aList!=null && aList.size()>0){ 
		for(int i=0;i<aList.size();i++){
			baseline = (cs5226.model.BaselineBean) aList.get(i);%>
			<tr><td><%=i+1%></td>
				<td><%=baseline.getBASELINE_ID()%></td>
				<td><%=baseline.getBASELINE_NAME()%></td>
				<td><%=baseline.getSTART_SNAP_ID()%></td>
				<td><%=baseline.getSTART_SNAP_TIME()%></td>
				<td><%=baseline.getEND_SNAP_ID()%></td>
				<td><%=baseline.getEND_SNAP_TIME()%></td>
				<td align="center"><input type="checkbox" name="baselineName" value="<%=baseline.getBASELINE_NAME()%>"></td>
			</tr>
		<%}%>
		<tr height="30"><td align="center" colspan="8"> <input type="submit" class='button' value="Compare"/> </td></tr>
	<%}else{%>
		<tr><td colspan="8">No Baseline Available!.</td></tr>
	<%}%>
</table>
</form>

<script>
	$(function() {		
		$('.button').button();
	});
</script>